<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>交账管理</title>
<jsp:include page="/header.jsp"></jsp:include>
<link href="${basePath }/css/ui.css" rel="stylesheet" type="text/css">
<style type="text/css"> .red{color: red;} </style>
<script type="text/javascript">
	function mysubmit() {
		var form = $("<form></form>");
		$.each($(".myinput"), function(i, n){
			var input = $("<input type='hidden' name='"+$(n).attr("title")+"' value='"+$(n).text()+"'>");
			form.append(input);
		});
		form.append("<input type='hidden' name='real_amount' value='"+$("#real_hand_amount").val()+"'>");
		form.append("<input type='hidden' name='should_amount' value='${summary.should_hand_amount }'>");
		//<span class="myinput" title="should_hand_amount">${summary.should_hand_amount }</span>
		$.ajax({
			url:"${basePath}/shift/save.htm",
			type:"post",
			data:form.serialize(),
			dataType:"json"
		}).done(function(data){
			$.jqalert(data.msg, "提示", function() {
				if(data.isSuccess) window.location = "${basePath}/shift/list.htm";
			})
		})
	}
</script>
</head>
<body>
	<div id="header_div" class="tab_li clearfix">
		<a href="${basePath }/shift/takeStock.htm" class="">下班盘点</a>
        <a href="${basePath }/shift/summary.htm" class="act">交账管理</a>
        <a href="${basePath }/shift/takeStockdiff.htm" class="">差异商品</a>
        <a href="${basePath }/shift/check_view.htm" class="">上班核实</a>
        <a href="${basePath }/shift/list.htm" class="">交班记录</a>
    </div>
    <div class="main">
    	<div class="cont">
        	<h2 class="title">货品信息：</h2>
        	<div class="b_div">
        		<p class="clearfix">
					<span class="info_s fl">上班库存数量：<span class="myinput" title="old_stock">${summary.old_stock }</span></span>
					<span class="info_s fl">门店收货数量：<span class="myinput" title="store_in_num">${summary.in_transfer_num }</span></span>
					<span class="info_s fl">商品回购数量：<span class="myinput" title="buyback_num">${summary.buyback_num }</span></span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">当班pos销售数量：<span class="myinput" title="pos_num">${summary.pos_num }</span></span>
					<span class="info_s fl">门店调出数量：<span class="myinput" title="store_out_num">${summary.out_transfer_num }</span></span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">下班库存数量：<span class="myinput" title="new_stock">${summary.new_stock }</span></span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">当班差异数量：<span class="myinput" title="sale_amount">${summary.duo_num+summary.shao_num }</span></span>
					<span class="info_s fl">多：<a href="${basePath }/shift/takeStockdiff.htm?type=1">${summary.duo_num }</a></span>
					<span class="info_s fl">少：<a href="${basePath }/shift/takeStockdiff.htm?type=2">${summary.shao_num }</a></span>
				</p>
			</div>
		</div>
        <div class="cont">
        	<h2 class="title">应交金额：</h2>
            <div class="b_div">
				<p class="clearfix">
					<span class="info_s fl">销售总收入金额：<span class="myinput" title="sale_amount">${summary.sum_sale_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">现金总收入金额：<span class="myinput" title="cash_amount">${summary.sum_cash_amount }</span>元</span>
					<span class="info_s fl">商品销售金额：<span class="myinput" title="cash_sale_amount">${summary.sale_cash_amount }</span>元</span>
					<span class="info_s fl">预收款金额：<span class="myinput" title="cash_advance_amount">${summary.advance_cash_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">刷卡总收入金额：<span class="myinput" title="bank_amount">${summary.sum_bank_amount }</span>元</span>
					<span class="info_s fl">商品销售金额：<span class="myinput" title="bank_sale_amount">${summary.sale_bank_amount }</span>元</span>
					<span class="info_s fl">预收款金额：<span class="myinput" title="bank_advance_amount">${summary.advance_bank_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">回购总支出金额：<span class="myinput" title="buyback_amount">${summary.sum_back_amount }</span>元</span>
					<span class="info_s fl">回购现金支出金额：<span class="myinput" title="buyback_cash_amount">${summary.back_cash_amount }</span>元</span>
					<span class="info_s fl">回购银行挂账金额：<span class="myinput" title="buyback_bank_amount">${summary.back_bank_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">日常总支出金额：<span class="myinput" title="daily_amount">${summary.daily_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">门店备用金金额：<span class="myinput" title="backup_amount">${summary.imprest_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">上班次剩余现金金额：<span class="myinput" title="left_amount">${summary.left_amount }</span>元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl red">应交现金金额=现金总收入金额+门店备用金基数+上班次剩余现金金额-回购总支出金额-日常总支出金额</span>
				</p>
			</div>
			
			<h2 class="title"></h2>
            <div class="b_div" id="pay_first_div">
				<p class="clearfix">
					<span class="info_s fl">本班次，应交现金金额：
						<span class="myinput" title="total_amount">${summary.should_hand_amount }</span>元
					</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">上交财务金额：5000.00元</span>
				</p>
				<p class="clearfix">
					<span class="info_s fl">本班次，实交现金金额：
						<input type="text" id="real_hand_amount" value="${summary.real_hand_amount }">元
					</span>
				</p>
			</div>
			<div class="text_c">
	        	<a href="javascript:;" class="yellow_btn btn" onclick="mysubmit();">提交</a>
	        </div>
        </div>
    </div>
</body>
</html>